package com.cqjtu.store.cart.mapper;

import com.cqjtu.store.cart.pojo.dto.CartDTO;
import com.cqjtu.store.cart.pojo.dto.entity.ShoppingCart;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CartMapper {
    List<ShoppingCart> getShoppingCartList(Integer userId);

    void delete(@Param("productId") Integer productId,@Param("userId") Integer userId);

    int addNum(@Param("productId") Integer productId,@Param("userId") Integer userId);

    int reduceNum(@Param("productId") Integer productId,@Param("userId") Integer userId);

    void updateNum(Integer num, Integer id, Integer id1);

    int purchase(ShoppingCart shoppingCart);

    int getPrice(Integer id);
}
